<footer class="ft-footer container">
    <div class="wrapper-boder">
        <div class="noti-info">
            <div class="location pull-left">
                <div>
                    <table>
                        <tr>
                            <td>
                                <h4><?php echo Yii::t('lang', 'location'); ?></h4>
                            </td>
                            <td>
                                <select class="custom_select" name="Event[location]">
                                    <option value="1" disabled><?php echo Yii::t('lang', 'hanoi') ?></option>
                                    <option value="2" disabled><?php echo Yii::t('lang', 'danang') ?></option>
                                    <option value="3" selected><?php echo Yii::t('lang', 'hochiminh') ?></option>
                                </select>
                            </td>

                            <td><h4><?php echo Yii::t('lang', 'today') ?></h4></td>
                            <td>
                                <form action="<?php echo Yii::app()->createUrl('site/eventdate') ?>" method="POST"
                                      id="date_time">
                                    <input type="text" id="datepicker" readonly="readonly" class="event_date"
                                           name="Event[date]" value="dd/mm/yy"/>
                                </form>
                            </td>
                        </tr>
                    </table>
                </div>

            </div>


        </div>
        <div class="clearfix"></div>
    </div>


    <div class="row" id="bar-bottom">
        <div class="col-xs-4 hotline pull-left">
            <span>
                <?php if(Yii::app()->session['_lang'] == 'vi') {echo Yii::app()->params['hot_line_vi'];}else {echo Yii::app()->params['hot_line_en'];}  ?>

            </span>
        </div>
        <div class="col-xs-4 display text-center cl-white  pull-left" style="padding-top: 7px;">
            <?php
            switch ($language) {
                case 'vi':
                    $language_code = 1;
                    break;

                default:
                    $language_code = 2;
                    # code...
                    break;
            }

            ?>
            <?php $noti = Cms::model()->findByAttributes(array('page_type' => 'ads', 'language_id' => $language_code)); ?>
            <?php if (isset($noti) && $noti->description != null) : ?>
                <p><?php echo $noti->description; ?></p>
            <?php endif; ?>
        </div>
        <div class="col-xs-4 display pull-right" style="margin-top: -3px;">
            <ul class="list-inline ft-social text-right">
                <li class="about-us">
                    <!-- <a style="text-decoration:none"> -->
                    <a onclick="showmodal($(this))" data-href="#myModal" role="button" class="btn" data-toggle="modal"
                       data-load-remote="<?php echo Yii::app()->createAbsoluteUrl('site/about'); ?>"
                       data-remote-target="#myModal .modal-body">
                        <img
                            src="<?php echo Yii::app()->theme->baseUrl; ?>/frontend/images/about.png"/><?php echo Yii::t('lang', 'aboutus'); ?>
                    </a>
                </li>
                <li class="help">
                    <!-- <a style="text-decoration:none"> -->
                    <a onclick="showmodal($(this))" data-href="#myModal" role="button" class="btn" data-toggle="modal"
                       data-load-remote="<?php echo Yii::app()->createAbsoluteUrl('site/help'); ?>"
                       data-remote-target="#myModal .modal-body">
                        <img src="<?php echo Yii::app()->theme->baseUrl; ?>/frontend/images/help.png"/>
                        <?php echo Yii::t('lang', 'help'); ?>
                    </a>
                </li>
                <li class="facebook"><a target="_blank" href="<?php echo Yii::app()->params['facebook']; ?>"><img
                            src="<?php echo Yii::app()->theme->baseUrl; ?>/frontend/images/facebook.png"/></a></li>
                <li class="youtube"><a target="_blank" href="<?php echo Yii::app()->params['link_youtube']; ?>"><img
                            src="<?php echo Yii::app()->theme->baseUrl; ?>/frontend/images/youtube.png"/></a></li>
            </ul>
        </div>
    </div>
</footer>
<script type="text/javascript">
    var horizontal = '<?php echo Yii::app()->theme->baseUrl; ?>/frontend/js/horizontal.js';
    $.getScript(horizontal);
    $(document).ready(function () {

        $(window).on('resize', function () {
            var number_li = $('.menuman li').length;
            var ul_width = $('.menuman').width();
            var ww = $(document).width();
            var height = $(document).innerHeight();
            if (ul_width < 500) {
                var li_width = ww / number_li - 2;
            }
            else {
                var li_width = ul_width / number_li - 2;
            }

            $('.menuman li').attr('style', 'width:' + li_width + 'px');
            if (ww > 768) {

                var url_horizon = 'http://darsa.in/sly/examples/js/horizontal.js';
                $('body').attr('style', 'background-position:top center !important');


            } else {
                if (height == 480) {
                    $('body').attr('style', 'background-size: 200% !important;background-position:top center !important');
                }
                if (height == 928) {
                    $('body').attr('style', 'background-size: 200% !important;background-position:top center !important');
                }
                else {
                    if (height > 928) {
                        $('body').attr('style', 'background-size: cover;background-position:top center !important');
                    }
                }
            }
            // if (ww == 320 && height > 480) {
            //     $('body').attr('style','background-size: cover;background-position:top center !important');
            // }
            // window.location.reload();
        });
        var width = $(window).width();
        var height = $(document).innerHeight();
        // alert(height);
        // console.log(height);
        if (width > 768) {
            var number_li = $('.menuman li').length;
            var ul_width = $('.menuman').width();

            var li_width = ul_width / number_li - 2;
            // console.log(width);
            $('.menuman li').attr('style', 'width:' + li_width + 'px');
            $('body').attr('style', 'background-position:top center !important');
        }
        if (width <= 768) {
            var number_li = $('.menuman li').length;
            var ul_width = $('.menuman').width();

            var li_width = width / number_li;
            $('.menuman li').attr('style', 'width:' + li_width + 'px');
            $('body').attr('style', 'background:url("<?php echo Yii::app()->baseUrl . "/data/background/" . Yii::app()->params["background"]; ?>")');
            if (height == 480) {
                $('body').attr('style', 'background-size: 200% !important;background-position:top center !important');
            }
            if (height == 928) {
                $('body').attr('style', 'background-size: 200% !important;background-position:top center !important');
            }
            else {
                if (height > 928) {
                    $('body').attr('style', 'background-size: cover;background-position:top center !important');
                }
                console.log('ab');

            }
            // $('body').attr('style','background-size: cover;background-position:top center !important');
        }
        // $('#body').css('display','block');
    });

</script>

<!-- Modal About Us -->
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content help-modal">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"><img
                        src="<?php echo Yii::app()->theme->baseUrl; ?>/frontend/images/icon_close.png"/></button>
            </div>
            <div class="modal-body help">
                <!-- <div class="text_info">

                </div> -->
            </div>
        </div>
    </div>
    <!-- /.modal-content -->
</div><!-- /.modal-dialog -->
